package com.ruoyi.project.surveys.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.surveys.mapper.SurveysInfoMapper;
import com.ruoyi.project.surveys.domain.SurveysInfo;
import com.ruoyi.project.surveys.service.ISurveysInfoService;

/**
 * 问卷基础信息Service业务层处理
 * 
 * @author zhimin-hu
 * @date 2020-05-02
 */
@Service
public class SurveysInfoServiceImpl implements ISurveysInfoService 
{
    @Autowired
    private SurveysInfoMapper surveysInfoMapper;

    /**
     * 查询问卷基础信息
     * 
     * @param id 问卷基础信息ID
     * @return 问卷基础信息
     */
    @Override
    public SurveysInfo selectSurveysInfoById(Long id)
    {
        return surveysInfoMapper.selectSurveysInfoById(id);
    }

    /**
     * 查询问卷基础信息列表
     * 
     * @param surveysInfo 问卷基础信息
     * @return 问卷基础信息
     */
    @Override
    public List<SurveysInfo> selectSurveysInfoList(SurveysInfo surveysInfo)
    {
        return surveysInfoMapper.selectSurveysInfoList(surveysInfo);
    }

    /**
     * 新增问卷基础信息
     * 
     * @param surveysInfo 问卷基础信息
     * @return 结果
     */
    @Override
    public int insertSurveysInfo(SurveysInfo surveysInfo)
    {
        surveysInfo.setCreateTime(DateUtils.getNowDate());
        return surveysInfoMapper.insertSurveysInfo(surveysInfo);
    }

    /**
     * 修改问卷基础信息
     * 
     * @param surveysInfo 问卷基础信息
     * @return 结果
     */
    @Override
    public int updateSurveysInfo(SurveysInfo surveysInfo)
    {
        surveysInfo.setUpdateTime(DateUtils.getNowDate());
        return surveysInfoMapper.updateSurveysInfo(surveysInfo);
    }

    /**
     * 批量删除问卷基础信息
     * 
     * @param ids 需要删除的问卷基础信息ID
     * @return 结果
     */
    @Override
    public int deleteSurveysInfoByIds(Long[] ids)
    {
        return surveysInfoMapper.deleteSurveysInfoByIds(ids);
    }

    /**
     * 删除问卷基础信息信息
     * 
     * @param id 问卷基础信息ID
     * @return 结果
     */
    @Override
    public int deleteSurveysInfoById(Long id)
    {
        return surveysInfoMapper.deleteSurveysInfoById(id);
    }
}
